home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
LAN
/
NETP.ARJ
/
NETP.DOC
< prev
next >
Wrap
Text File
|
1992-03-19
|
9KB
|
177 lines
NetPrompt
Version 1.00
F. Brett Platko
NetPrompt is a small (under 3K) TSR that dynamically modifies a workstation's
prompt syntax to show current [FileServer / Volume] names in addition to
the regular user prompt string.
As the user changes the default drive, NetPrompt automatically edits the user's
workstation Master Environment data to reflect the new prompt string. Because
we edit the master environment changes will not be noticed if we are shelled
from a program, or are running under a secondary command.com.
Usage:
NetPrompt can be started with the following options:
NETP /U = Unload the NetPrompt program if loaded last. If there
is a memory resident program loaded after NetPrompt,
the user is notified that NetPrompt could not be unloaded.
NETP /NI = NO Introduction Screen. This is handy if NetPrompt is
loaded from a batch file. /NI suppresses the display of
the startup screen.
NETP /P= = Use optional prompt string. If the user prefers to use
a prompt string other than the default "$P$Q$G" they can
define it using the /P option. Prompt strings that contain
spaces, ie. "THIS IS A PROMPT $P$Q$G" must be contained in
double quotes.
NOTICE: => NetPrompt REQUIRES NetWare Shell version 3.22 or later (NETX) to
operate properly. If you have problems using NetPrompt be sure
that you are using NETX for a Shell driver. (NETX is provided
with this release of NetPrompt.)
This program is released to the public domain as a needed utility and as a
guide for programers using Omega Point's CodeRunner TSR libraries. The supplied
source code is provided as examples to accessing DOS environment and network
resources. The files contained in thes NetP.Zip file are:
NetP.Exe NetPrompt Executable Program.
NPD.C NetPrompt Disposable Data Module.
NPI.C NetPrompt Disposable Installation Code Module.
NPR.C NetPrompt Resident Code Module.
DONP.Bat Batch File for Compiling NetP.Exe
Netp.Doc This Document File.
NETX.Com Novell NetWare Network Shell Version 3.22
If you have questions are comments on this utility or on the programing code
feel free to reach me on CompuServe 70441,622.
Enjoy,
Brett...
Programing Notes:
This section covers the programing logic used to create NetP.Exe. This program
was written using the CodeRunner and Professional Developer Kit libraries from
Omega Point, Inc. and the Borland C++ complier.
Omega Point Inc. are the developers of a group of TSR libraries for 'C'
programmers. Their libraries were used extensively in the development of
NetPrompt. The libraries contain more than 300 functions (most replacing the
standard Small-Model functions of your C complier) of optimized assembly
language. OPI libraries work with Turbo-C, Borland C++, Zortech C, TopSpeed
C, and Microsoft C.
OPI's TSR development platform permits the programer to eliminate
initialization code and data when the program go resident. The TSR resident
code can be activated by hardware or BIOS level hot-keys, software or
hardware interrupts, and by system timing events.
For information on CodeRunner libraries you can contact OPI at:
Omega Point, Inc.
25 Birch Road
Framingham, MA 01701
(508) 887-1819
Program Explanation:
CodeRunner libs permit a high degree of TSR size and speed optimization.
NetPrompt's current TSR size could be compacted to smaller code unfortunately,
at the sacrifice of readability. If this was a commercial program I would not
be happy unless the TSR resident size was under 2K. I leave it to the
user/programer to optimize NetPrompt if they wish.
There are three program modules to NetPrompt. The first is the disposable
data file NPD.c. This file's data (this file contains only data) will
be disposed when the NetPrompt go resident.
The data contained in this module is used by the install code (NPI.c) for
displaying Intro screens, parsing the command line, defining the TSR signature
block. The keyword init_data_end marks the end of disposable data when the
files are linked.
The disposable install code module NPI.c first preforms variable initialization,
command line argument parsing, and then displays the intro screen. The rest of
the main function checks to see if the NetWare shell has been loaded, and
then checks if the TSR has been loaded before. Main then initializes mEnvSeg
(the segment of the Master Environment Block where the prompt string is
located). By examining the value of offset 3 in the Memory Control Block
belonging to the Env Block, we can get the Env Block size.
We then issue the CodeRunner stay resident function and Interrupt trap
function. The program is now resident. The NetPrompt program operates by
trapping Interrupt 21 calls. To do this we define a interrupt trap structure
(trap_rec in NPR.c) that identifies which DOS interrupt to trap.
The resident code module NPR.c contains the meat of the program. This is the
code and data that remains in memory when NetPrompt terminates. This is the
module that could benefit with optimization.
The function isr21 is called each time a interrupt 21 is detected. This
function examines the contents of AX to detect if a DOS GetDefaultDiskDrive
(19 Hex) request is made. If it is not, the interrupt is passed down the
interrupt chain. If it is a 19H request, a CodeRunner function at_disk_prompt
determines if the user is at the DOS command prompt. If so, we begin to
process the Prompt command.
The ProcessPrompt function begins by getting network information based on the
current drive letter. Once we have the network data and have built the new
prompt string, we access the Master Environmet block and determine the
location of the 0x00 0x00 (end of env data) codes. We then search for the
current location of the PROMPT= string and remove it by moving the rest
of the env data into its location (packing.) The new prompt is annotated to
the end of the data and terminating 0x00 0x00 codes are added.
The isr21 function then permits the DOS interrupt 19H call to continue.
That's It, Enjoy!
Oh, yea, almost forgot the disclaimer (what a bunch of bother):
The software and accompanying written materials (including instructions for
use) are provided "AS IS" without warranty of any kind. Further, I do not
warrant, guarantee, or make any representations regarding the use, or the
results of the use, of the software or written materials in terms of
correctness, accuracy, reliability, currentness, or otherwise. The entire
risk as to the result and performance of the program is assumed by you. If
the program or written materials are defective you, and not me, assume the
entire cost of all necessary servicing, repair, or correction.
No warranties of any kind, either express or implied, including but not
limited to the implied warranties of merchantability and fitness for a
particular purpose, that are made by me on this product. No oral or written
information or advice given by me shall create a warranty or in any way
increase the scope of this warranty, and you may not rely on any such
information or advice. This warranty gives you specific legal rights. You
may have other legal rights, which vary from state to state.
Neither me or anyone else who has been involved with the creation, production,
or delivery of this program shall be liable for any direct, indirect,
consequential, or incidental damages (including but not limited to damages
for loss of business profits, business interruption, loss of business
information, and the like) arising out of the use or inability to use such
product even if I have been advised of the possibility of such damages.
Because some states do not allow the exclusion or limitation of liability
for consequential or incidental damages, the above limitation may not apply
to you.
Trademarks: All trademarks and copyrights belong to their respective holders.